﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace ТХИ4
{
	public class SumPrice
	{
        public int SumAllPrice(Bouquet BouDecAndPot, int l, int r, int t, int a)
        {
            int TotalPrice = 0;
            List<Flower> flower = BouDecAndPot.flower;
            TotalPrice = flower[0].Price * l + flower[1].Price * r + flower[2].Price * t + flower[3].Price * a + flower[4].Price * g;
            
            FileStream fs = new FileStream("D:/важное/ТХИ4/Log.txt", FileMode.Append, FileAccess.Write);
            StreamWriter sw = new StreamWriter(fs);
            sw.WriteLine(flower[0].Name + " = " + l + " * " + flower[0].Price + " руб.");
            sw.WriteLine(flower[1].Name + " = " + r + " * " + flower[1].Price + " руб.");
            sw.WriteLine(flower[2].Name + " = " + t + " * " + flower[2].Price + " руб.");
            sw.WriteLine(flower[3].Name + " = " + a + " * " + flower[3].Price + " руб.");
            sw.WriteLine(flower[4].Name + " = " + g + " * " + flower[4].Price + " руб.");

            sw.WriteLine("\tВся стоимость = " + TotalPrice + " руб." + Environment.NewLine + Environment.NewLine);

            sw.Close();

            return TotalPrice;
        }
	}
}